package com.adtech.farmProducts.adapter;

import android.view.View;
import android.widget.TextView;

import com.adtech.common.widgets.recycler.RecyclerViewAdapter;
import com.adtech.farmProducts.R;
import com.adtech.farmProducts.blue.adapter.Event;


/**
 * Author:  xiaocz.
 * Date:    2018/05.04.
 * Descr:  额外费用
 */
public class ExtraPriceListAdapter extends RecyclerViewAdapter<Event> {

    public ExtraPriceListAdapter(AdapterListener<Event> adapterListener) {
        super(adapterListener);
    }

    @Override
    protected int getItemViewType(int position, Event data) {
        return R.layout.item_redio;
    }

    @Override
    protected ViewHolder<Event> getViewHolder(View view, int viewType) {
        return new ExtraPriceListAdapter.CouponsViewHolder(view);
    }

    private static class CouponsViewHolder extends ViewHolder<Event> {

        private TextView rbBilling;

        /**
         * 构造方法
         *
         * @param itemView
         */
        public CouponsViewHolder(View itemView) {
            super(itemView);
            rbBilling = itemView.findViewById(R.id.rb_billing);
        }

        @Override
        protected void onBind(final Event data, final int position) {
            rbBilling.setText(data.getName());
        }

        @Override
        public boolean isNeedClick() {
            return true;
        }
    }
}
